import {type MockMethod} from "vite-plugin-mock";
import {authUserAssetLoadUrl} from "../src/apis/url";

const mock: Array<MockMethod> = [
    /**
     * 路由数据接口
     */
    {
        url: authUserAssetLoadUrl('/mock'),
        method: 'post',
        response: () => {
            // 路由
            const menus = [
                {
                    routePath: '/realm-list',
                    routeName: 'realmList',
                    component: '/RealmList',
                    menuType:0,
                    meta: {
                        title: "领域管理",
                        icon: "User",
                        mode: "vertical",
                        keepAlive: true,
                    },
                    children: [
                        {
                            routePath: 'info',
                            routeName: 'realmInfo',
                            component: 'RealmInfo',
                            menuType:1,
                            meta: {
                                title: "领域信息",
                                icon: "Menu",
                                mode: "vertical",
                                keepAlive: true,
                            },
                        },
                        // {
                        //     routePath: 'auth',
                        //     routeName: 'authInfo',
                        //     component: 'RealmInfo',
                        //     menuType:1,
                        //     meta: {
                        //         title: "认证配置",
                        //         icon: "Van",
                        //         mode: "vertical",
                        //         keepAlive: true,
                        //     },
                        // },
                        {
                            routePath: 'user-list/:id*',
                            routeName: 'realmUserList',
                            component: 'RealmUserList',
                            menuType:1,
                            meta: {
                                title: "用户列表",
                                icon: "User",
                                mode: "vertical",
                                keepAlive: true,
                            },
                        },
                        {
                            routePath: 'user-group/:id*',
                            routeName: 'realmUserGroup',
                            component: 'UserGroupList',
                            menuType:1,
                            meta: {
                                title: "用户分组",
                                icon: "UserFilled",
                                mode: "vertical",
                                keepAlive: true,
                            },
                        },
                        {
                            routePath: 'setting',
                            routeName: 'realmSetting',
                            component: 'RealmSetting',
                            menuType:1,
                            meta: {
                                title: "领域设置",
                                icon: "Setting",
                                mode: "vertical",
                                keepAlive: true,
                            },
                        }
                    ]
                },
                {
                    routePath: '/platform-list',
                    routeName: 'platformList',
                    component: '/PlatformList',
                    menuType:0,
                    meta: {
                        title: "平台管理",
                        icon: "OfficeBuilding",
                        mode: "vertical",
                        keepAlive: true,
                    },
                    children: [
                        // {
                        //     routePath: 'dashboard',
                        //     routeName: 'dashboard',
                        //     component: 'Dashboard',
                        //     menuType:1,
                        //     meta: {
                        //         title: "首页",
                        //         icon: "House",
                        //         keepAlive: true,
                        //     }
                        // },
                        {
                            routePath: 'realm-info/:id*',
                            routeName: 'platformRealm',
                            component: 'PlatformRealm',
                            menuType:1,
                            meta: {
                                title: "领域信息",
                                icon: "Operation",
                                keepAlive: true,
                            }
                        },
                        // {
                        //     routePath: 'tenant-info/:id*',
                        //     routeName: 'platformTenant',
                        //     component: 'TenantList',
                        //     menuType:1,
                        //     meta: {
                        //         title: "租户列表",
                        //         icon: "Stamp",
                        //         keepAlive: true,
                        //         hidden: true,
                        //     }
                        // },
                        // {
                        //     routePath: 'application-info/:id*',
                        //     routeName: 'platformApp',
                        //     component: 'ApplicationList',
                        //     menuType:1,
                        //     meta: {
                        //         title: "应用列表",
                        //         icon: "DocumentCopy",
                        //         keepAlive: true,
                        //     }
                        // },
                        // {
                        //     routePath: 'product-info/:id*',
                        //     routeName: 'platformProduct',
                        //     component: 'ProductList',
                        //     menuType:1,
                        //     meta: {
                        //         title: "产品管理",
                        //         icon: "DocumentCopy",
                        //         keepAlive: true,
                        //     }
                        // },
                        {
                            routePath: 'user-mng',
                            routeName: 'userMng',
                            component: 'UserMng',
                            menuType:0,
                            meta: {
                                title: "用户管理",
                                icon: "User",
                                keepAlive: true,
                            },
                            children: [
                                {
                                    routePath: 'user-list/:id*',
                                    routeName: 'userList',
                                    component: 'PlatformUserList',
                                    menuType:1,
                                    meta: {
                                        title: "用户列表",
                                        keepAlive: true,
                                    },
                                },
                                {
                                    routePath: 'user-group/:id*',
                                    routeName: 'userGroupMng',
                                    component: 'PlatformUserGroup',
                                    menuType:1,
                                    meta: {
                                        title: "用户分组",
                                        keepAlive: true,
                                    },
                                }
                            ]
                        },
                        {
                            routePath: 'assets',
                            routeName: 'assets',
                            component: 'SystemMng',
                            menuType:0,
                            meta: {
                                title: "资源管理",
                                icon: "Setting",
                                keepAlive: true,
                            },
                            children: [
                                // {
                                //     routePath: 'groups/:id*',
                                //     routeName: 'groupMng',
                                //     component: 'GroupList',
                                //     menuType:1,
                                //     meta: {
                                //         title: "分组管理",
                                //         keepAlive: true,
                                //     },
                                // },
                                {
                                    routePath: 'menus/:id*',
                                    routeName: 'menuMng',
                                    component: 'MenuList',
                                    menuType:1,
                                    meta: {
                                        title: "菜单管理",
                                        keepAlive: true,
                                    },
                                },
                                {
                                    routePath: 'clients/:id*',
                                    routeName: 'clientMng',
                                    component: 'ClientList',
                                    menuType:1,
                                    meta: {
                                        title: "客户管理",
                                        keepAlive: true,
                                    },
                                    children: [
                                        {
                                            routePath: '',
                                            routeName: '分配',
                                            code: 'assign',
                                            menuType:2,
                                        },
                                        {
                                            routePath: '',
                                            routeName: '删除',
                                            code: 'delete',
                                            menuType:2,
                                        },
                                    ]
                                },
                                {
                                    routePath: 'roles/:id*',
                                    routeName: 'roleMng',
                                    component: 'RoleList',
                                    menuType:1,
                                    meta: {
                                        title: "角色管理",
                                        keepAlive: true,
                                    },
                                    children: [
                                        {
                                            routePath: '',
                                            routeName: '分配',
                                            code: 'assign',
                                            menuType:2,
                                        },
                                        {
                                            routePath: '',
                                            routeName: '删除',
                                            code: 'delete',
                                            menuType:2,
                                        },
                                    ]
                                },
                                {
                                    routePath: 'permit/:id*',
                                    routeName: 'permitMng',
                                    component: 'PermitList',
                                    menuType:1,
                                    meta: {
                                        title: "权限管理",
                                        keepAlive: true,
                                    },
                                },
                                {
                                    routePath: 'url/:id*',
                                    routeName: 'urlMng',
                                    component: 'UrlList',
                                    menuType:1,
                                    meta: {
                                        title: "地址管理",
                                        keepAlive: true,
                                    },
                                },
                                // {
                                //     routePath: 'api/:id*',
                                //     routeName: 'apiMng',
                                //     component: 'ApiList',
                                //     menuType:1,
                                //     meta: {
                                //         title: "接口管理",
                                //         keepAlive: true,
                                //     },
                                // },
                            ]
                        },
                        {
                            routePath: 'log-mng',
                            routeName: 'logMng',
                            component: 'LogMng',
                            menuType:0,
                            meta: {
                                title: "日志管理",
                                icon: "Memo",
                                keepAlive: true,
                            },
                            children: [
                                {
                                    routePath: 'login-log',
                                    routeName: 'loginLog',
                                    component: 'LoginLog',
                                    menuType:1,
                                    meta: {
                                        title: "登录日志",
                                        keepAlive: true,
                                    },
                                },
                                {
                                    routePath: 'audit-log',
                                    routeName: 'auditLog',
                                    component: 'AuditLog',
                                    menuType:1,
                                    meta: {
                                        title: "审计日志",
                                        keepAlive: true,
                                    },
                                },
                                {
                                    routePath: 'call-log',
                                    routeName: 'callingLog',
                                    component: 'CallingLog',
                                    menuType:1,
                                    meta: {
                                        title: "接口日志",
                                        keepAlive: true,
                                    },
                                },
                            ]
                        },
                    ],
                },
                {
                    routePath: 'system-log',
                    routeName: 'systemLog',
                    component: '/SystemLog',
                    menuType:1,
                    meta: {
                        title: "系统日志",
                        icon: "Tickets",
                        keepAlive: true,
                    },
                },
            ]

            return {
                code: 0,
                message: 'success',
                data: {
                    menus: menus,
                    roleCodes: ['system', 'platform', 'tenant']
                }
            }
        }
    }
]

export default mock;
